{% extends './layout.html.twig' %}

{% block title %}Backtesting Results | Crypto Bot{% endblock %}

{% block stylesheet %}
    <link rel="stylesheet" href="/css/backtest.css?v={{ asset_version() }}">
{% endblock %}

{% block content %}
    <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <section class="content-header">
            <div class="container">
                <div class="row mb-2">
                    <div class="col-sm-6">
                        <h1>Backtesting Results</h1>
                    </div>
                    <div class="col-sm-6">
                        <ol class="breadcrumb float-sm-right">
                            <li class="breadcrumb-item"><a href="{{ '/' }}">Dashboard</a></li>
                            <li class="breadcrumb-item active">Backtesting Results</li>
                        </ol>
                    </div>
                </div>
            </div><!-- /.container-fluid -->
        </section>
        <!-- /.Content Header (Page header) -->

        <!-- Main content -->
        <div class="content">
            <div class="container">
                <div class="row">
                    {% for backtest in backtests %}
                    <div class="col-md-12">
                        <div class="card">
                            <div class="card-header">
                                <h3 class="card-title">{{ backtest.pair }} <span class="text-muted"> - {{ backtest.result.strategy }} - {{ backtest.result.configuration.period }} - {{ backtest.result.start|date('y-m-d H:i:s') }} - {{ backtest.result.end|date('y-m-d H:i:s') }}</span></h3>
                            </div>
                            <!-- /.card-header -->
                            <div class="card-body">
                                {% include 'components/backtest_summary.html.twig' with {
                                    'summary': backtest.result.summary
                                } only %}
                            </div>
                        </div>
                    </div>
                    {% endfor %}
                </div>
                <!-- /.row -->
            </div><!-- /.container-fluid -->
        </div>
        <!-- /.content -->
    </div>
    <!-- /.content-wrapper -->
{% endblock %}

{% block javascript %}
<script src="https://d3js.org/d3.v4.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/techan.js/0.8.0/techan.min.js"></script>
<script src="/js/backtest.js?v={{ asset_version() }}"></script>
{% endblock %}
